/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package isd.resto.modelo;

import isd.general.modelo.GR_Auditoria;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Claudio
 */
@Entity
@Table(name = "rtmozo")
public class RT_Mozo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "CODIGO", nullable = false, length = 2)
    private String codigo;
    @Column(name = "NOMBRE", length = 50)
    private String nombre;
    @Column(name = "COMISION", precision = 10, scale = 2)
    private BigDecimal comision;


    @JoinColumn(name = "COD_MESA", referencedColumnName = "CODIGO", nullable = false)
    @ManyToOne
    private RT_Mesa mesa;
    
    @Embedded
    private GR_Auditoria auditoria;


    public RT_Mozo() {
    }

    public RT_Mozo(String codigo) {
        this.codigo = codigo;
    }

    public String getCodigo() {
        return codigo;
    }

    public void setCodigo(String codigo) {
        this.codigo = codigo;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public BigDecimal getComision() {
        return comision;
    }

    public void setComision(BigDecimal comision) {
        this.comision = comision;
    }

    public RT_Mesa getMesa() {
        return mesa;
    }

    public void setMesa(RT_Mesa mesa) {
        this.mesa = mesa;
    }
    
    public GR_Auditoria getAuditoria() {
        return auditoria;
    }

    public void setAuditoria(GR_Auditoria auditoria) {
        this.auditoria = auditoria;
    }
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codigo != null ? codigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RT_Mozo)) {
            return false;
        }
        RT_Mozo other = (RT_Mozo) object;
        if ((this.codigo == null && other.codigo != null) || (this.codigo != null && !this.codigo.equals(other.codigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "isd.resto.modelo.RT_Mozo[codigo=" + codigo + "]";
    }

}
